public class Course {
    String name;
    int capacity;
    int selectedNum;
    Teacher teacher;
    public Course(String name, int capacity) {
        this.name = name;
        this.capacity = capacity;
        this.selectedNum = 0;
    }

    public boolean select() {
        return selectedNum < capacity && (selectedNum++) >= 0;
    }

    public boolean drop() {
        return selectedNum > 0 && (selectedNum--) >= 0;
    }
}